//
//  ViewController.swift
//  Psychologist
//
//  Created by sdw on 15/11/12.
//  Copyright (c) 2015年 ai.com. All rights reserved.
//

import UIKit

class PsychologistViewController: UIViewController {


    @IBAction func dreamNothing(sender: UIButton) {
        performSegueWithIdentifier( "nothing", sender: nil)
    }
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        var destination = segue.destinationViewController as? UIViewController
        if let navCon = destination as? UINavigationController {
            destination = navCon.visibleViewController
        }
        
        if let hvc = destination as? HappinessViewController{
            if let identifier = segue.identifier{
                switch identifier {
                    case "afraid":
                        hvc.happiness = 0
                    case "happy":
                        hvc.happiness = 100
                    case "nothing":
                        hvc.happiness = 75
                    default : hvc.happiness = 55
                }
            }
        }
    }


}

